package com.project.server.service.operate.impl;

import com.project.common.core.domain.BaseServer;
import com.project.server.domain.operate.TOperateNotice;
import com.project.server.mapper.operate.TOperateNoticeMapper;
import com.project.server.service.operate.ITOperateNoticeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 通知公告Service业务层处理
 *
 * @author project
 * @date 2021-06-29
 */
@Service
public class TOperateNoticeServiceImpl extends BaseServer implements ITOperateNoticeService {

    private static final Logger log = LoggerFactory.getLogger(TOperateNoticeServiceImpl.class);

    @Resource
    private TOperateNoticeMapper tOperateNoticeMapper;

    /**
     * 查询通知公告
     *
     * @param noticeId 通知公告ID
     * @return 通知公告
     */
    @Override
    public TOperateNotice selectTOperateNoticeById(Long noticeId) {
        return tOperateNoticeMapper.selectTOperateNoticeById(noticeId);
    }

    /**
     * 查询通知公告列表
     *
     * @param tOperateNotice 通知公告
     * @return 通知公告
     */
    @Override
    public List<TOperateNotice> selectTOperateNoticeList(TOperateNotice tOperateNotice) {
        return tOperateNoticeMapper.selectTOperateNoticeList(tOperateNotice);
    }

    /**
     * 新增通知公告
     *
     * @param tOperateNotice 通知公告
     * @return 结果
     */
    @Override
    public int insertTOperateNotice(TOperateNotice tOperateNotice) {
        super.insert(tOperateNotice);
        return tOperateNoticeMapper.insertTOperateNotice(tOperateNotice);
    }

    /**
     * 修改通知公告
     *
     * @param tOperateNotice 通知公告
     * @return 结果
     */
    @Override
    public int updateTOperateNotice(TOperateNotice tOperateNotice) {
        super.update(tOperateNotice);
        return tOperateNoticeMapper.updateTOperateNotice(tOperateNotice);
    }

    /**
     * 批量删除通知公告
     *
     * @param noticeIds 需要删除的通知公告ID
     * @return 结果
     */
    @Override
    public int deleteTOperateNoticeByIds(Long[] noticeIds) {
        return tOperateNoticeMapper.deleteTOperateNoticeByIds(noticeIds);
    }

    /**
     * 删除通知公告信息
     *
     * @param noticeId 通知公告ID
     * @return 结果
     */
    @Override
    public int deleteTOperateNoticeById(Long noticeId) {
        return tOperateNoticeMapper.deleteTOperateNoticeById(noticeId);
    }
}
